package cn.lx.security.authcenter.controller;

import cn.lx.security.authcenter.entity.PortalUserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @ClassName UserController
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/7/16 08:19
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/7/16 08:19
 * @UpdateRemark:
 * @Version: 1.0
 */
@RestController
public class UserController {

    @GetMapping("/userinfo")
    public PortalUserDetails getUserInfo(Principal principal) {
        // 根据 principal 获取用户信息，返回 PortalUserDetails 对象
        PortalUserDetails userDetails = new PortalUserDetails();
        userDetails.setOpterNo("001");
        userDetails.setUserAcct("user");
        userDetails.setUactID("001");
        userDetails.setName("测试用户");
        userDetails.setOrgUntID("ORG001");
        userDetails.setOrgName("测试机构");
        userDetails.setOrgCodg("ORG001");
        userDetails.setPoolAreaCodg("AREA001");
        userDetails.setDeptID("DEPT001");
        userDetails.setDeptName("测试部门");
        userDetails.setAdmDvs("1");
        userDetails.setPrntOrgID("PARENT001");

        return userDetails;
    }
}
